﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Threading;
using System.Globalization;

    public sealed class MyCulture
    {

        public static void SetCulture()
        {

            String selectedLanguage;

            if (HttpContext.Current.Request["lang"] != null)
                selectedLanguage = HttpContext.Current.Request["lang"].ToString();
            else
                selectedLanguage = ConfigurationManager.AppSettings["DefaultCulture"].ToString();

            Thread.CurrentThread.CurrentCulture =
                CultureInfo.CreateSpecificCulture(selectedLanguage);
            Thread.CurrentThread.CurrentUICulture = new
                CultureInfo(selectedLanguage);
        }
    }
